﻿Imports TNCBAL
Imports TNCDAL

Public Class ucContTransportCharges

    Private _objContFeeController As New ContFeeController
    Private _objCont As tblCont

    Public Sub New()
        InitializeComponent()
    End Sub

    ''' <summary>
    ''' Gọi hàm khởi tạo này nếu muốn lấy các MBL của một File
    ''' </summary>
    ''' <param name="obj"></param>
    ''' <remarks></remarks>
    Public Sub New(ByVal obj As tblCont)
        InitializeComponent()
        'Lưu thông tin File
        _objCont = obj
    End Sub

    Private Sub ucContTransportCharges_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim query = _objContFeeController.SelectCustomContFee(_objCont.ID_Cont)
        dataGridViewXTransportCharges.DataSource = query
    End Sub

    Public Sub BindDataGridView()
        Dim query As IQueryable
        If _objCont IsNot Nothing Then
            query = _objContFeeController.SelectCustomContFee(_objCont.ID_Cont)
        End If

        dataGridViewXTransportCharges.DataSource = query
        'dataGridViewXTransportCharges.Columns("ID_FileMBL").Visible = False
        'dataGridViewXTransportCharges.Columns("tblFile").Visible = False
    End Sub

    Public Sub FormatDataGridView()
        dataGridViewXTransportCharges.AllowUserToAddRows = False
        dataGridViewXTransportCharges.AllowUserToDeleteRows = False
        dataGridViewXTransportCharges.ReadOnly = True
        dataGridViewXTransportCharges.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
    End Sub

    Public dataGridViewXTransportCharges_CurrentCellChangedEvent As EventHandler
    Private Sub dataGridViewXHBL_CurrentCellChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dataGridViewXTransportCharges.CurrentCellChanged
        If dataGridViewXTransportCharges_CurrentCellChangedEvent IsNot Nothing Then
            dataGridViewXTransportCharges_CurrentCellChangedEvent(sender, e)
        End If
    End Sub

    Private Sub PanelExCommand_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PanelExCommand.Click

    End Sub

    Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click

    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click

    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

    End Sub
End Class
